package com.creawor.hz_market.util;

import java.awt.image.BufferedImage;

import com.creawor.ImageTools;
import com.creawor.filter.SSOFilter;

public class ImageCreate {
	public static boolean createCustomerIcon(String outImg,String content){
		boolean flg=false;
		String webroot=SSOFilter.webroot;
		String inputName=webroot+"images/customer.png";
		ImageTools tools = new ImageTools();
		BufferedImage img=tools.loadImageLocal(inputName);
		tools.modifyImage(img, content, 0, 30);
		tools.writeImageLocal(webroot+"images/customer/"+outImg+".png", img);
		return flg;
	}
	
	public static boolean createGroupIcon(String outImg,String content,String type){
		boolean flg=false;
		String webroot=SSOFilter.webroot;
		ImageTools tools = new ImageTools();
		BufferedImage img=null;
		if("A".equals(type))
		{
			img=tools.loadImageLocal(webroot+"images/group_cm_A_1.png");
	
		}
		else if("B".equals(type))
		{
			img=tools.loadImageLocal(webroot+"images/group_cm_B_1.png");
		}
		else if("C".equals(type))
		{
			img=tools.loadImageLocal(webroot+"images/group_cm_C-1.png");
		}
		
		tools.modifyImage(img, content, 0, 30);
		tools.writeImageLocal(webroot+"images/group/"+outImg+".png", img);
		return flg;
	}
	
	
	public static void main(String[]args){
		//ImageCreate.createCustomerIcon("d:/aa.jpg", "d:/bb.jpg", "pioneer");
	}

}
